home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS
/
PRO050.dsk
/
CAT.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
5KB
|
170 lines
10 GOSUB 62000
15 D$ = CHR$(4)
20 PRINT D$;"PR#3"
100 U = 1:K = 0
2000 GOTO 4020
2200 REM READ TIME
2205 IF FC = 1 THEN TM$ = "": RETURN
2210 PRINT D$;"IN#4": PRINT D$;"PR#4"
2220 INPUT ":";CK$
2230 PRINT D$;"IN#0": PRINT D$;"PR#0"
2240 PRINT D$;"PR#3"
2260 TM$ = MID$ (CK$,12,2) +":" + MID$ (CK$,15,2)
2270 X = VAL( MID$ (CK$,12,2))
2280 IF X <12 THEN TM$ = TM$ +" A.M.": RETURN
2290 IF X <13 THEN TM$ = TM$ +" P.M.": RETURN
2300 X = X -12:X$ = STR$(X):TM$ = X$ + RIGHT$(TM$,3) +" P.M."
2310 RETURN
4000 REM CATEGORIES MENU
4010 GOSUB 2200
4020 HOME : PRINT
4030 HTAB 31: VTAB 1: PRINT "CATEGORIES SECTION"
4040 HTAB 28: PRINT "========================"
4050 HTAB 28: VTAB 7: PRINT "A) ADD NEW CATEGORY"
4055 HTAB 28: PRINT "I) LIST EXISTING CATEGORIES"
4060 HTAB 28: PRINT "M) MAIN MENU"
4075 HTAB 28: PRINT "T) EDIT EXISTING CATEGORY"
4080 HTAB 69: VTAB 23: PRINT TM$
4090 HTAB 40: VTAB 20: GET X$
4100 IF X$ = "A" OR X$ = "a" THEN 5000
4110 IF X$ = "M" OR X$ = "m" THEN 10000
4120 IF X$ = "I" OR X$ = "i" THEN FI = 1: GOTO 9000
4130 IF X$ = "T" OR X$ = "t" THEN 6000
4140 IF X$ < >"t" THEN 4000
5000 REM ADD A CATEGORY
5010 FOR I = 1 TO 40
5020 IF LEN(CG$(I)) <1 THEN 5040
5030 NEXT
5040 HOME
5050 HTAB 32: VTAB 5
5060 PRINT "ENTER THE NEW CATEGORY"
5070 HTAB 38: VTAB 10: INPUT "";CG$
5072 IF LEN(CG$) >8 THEN HTAB 22: VTAB 12: PRINT "TOO LONG. YOU MAY ONLY USE 8 SPACES": HTAB 40: VTAB 14: GET X$: GOTO 5040
5075 IF LEN(CG$) <1 THEN HTAB 22: VTAB 12: PRINT "TOO SHORT. YOU MUST ENTER SOMETHING": HTAB 40: VTAB 14: GET X$: GOTO 4000
5080 CG$(I) = CG$
5090 GOTO 8000
6000 REM EDIT A CATEGORY
6010 HOME
6020 HTAB 23: VTAB 5: PRINT "WHICH CATEGORY WOULD YOU LIKE TO EDIT?"
6030 IN$ = ""
6040 HTAB 35 +K: VTAB 8: PRINT IN$;
6050 GET X$: IF X$ < > CHR$(13) THEN IN$ = IN$ +X$: GOTO 6300
6060 GOTO 6050
6070 HTAB 35: VTAB 8: PRINT IN$:YY$ = IN$: GOTO 6500
6110 NEXT
6300 IF X$ = CHR$(27) THEN 4000
6305 FOR I = 1 TO 40
6310 IF LEN(CG$(I)) <1 THEN 6330
6320 IF IN$ = LEFT$(CG$(I), LEN(IN$)) THEN K = K +1:Z$ = CG$(I):Q = I
6325 NEXT
6330 IF K = 1 THEN K = 0:IN$ = Z$: GOTO 6070
6340 IF K = 0 THEN 6000
6350 K = 0: GOTO 6040
6500 HTAB 30: VTAB 12: PRINT "ENTER THE NEW CATEGORY"
6510 HTAB 37: VTAB 14: INPUT "";IN$
6520 IF LEN(IN$) >8 THEN 6500
6525 IF LEN(IN$) <1 THEN VTAB 16: HTAB 10: PRINT "YOU MUST MERGE YOUR OLD DATA INTO A NEW OR EXISTING CATEGORY": HTAB 40: VTAB 17: GET X$: GOTO 4000
6530 HTAB 18: VTAB 18: PRINT "ALL ";YY$;" WILL BE REPLACED WITH ";IN$
6535 HTAB 10: VTAB 19: PRINT "YEARLY BUDGET FOR ";IN$;" WILL BE THE SAME AS ";YY$;" WAS"
6540 HTAB 23: VTAB 22: PRINT "PRESS <`> TO ENTER OR <ESC> TO EXIT"
6550 HTAB 40: VTAB 23: GET X$
6560 IF X$ = CHR$(27) THEN 4000
6570 IF X$ = "`" OR X$ = "~" THEN 6590
6580 IF X$ < >"`" THEN 6550
6590 FOR R = 1 TO 40
6600 IF IN$ = CG$(R) THEN VC = Q:Q = R:CG$(VC) = "\\\": GOTO 6630
6610 NEXT
6620 CG$(Q) = IN$
6630 PRINT D$;"OPEN /RAM/MAIN.DATA,L$96"
6640 ZN = FTN% -1
6650 FOR R = 1 TO ZN
6660 TN = R
6670 PRINT D$;"READ /RAM/MAIN.DATA,R";TN
6680 INPUT TN%
6690 INPUT DT$
6700 INPUT CN$
6710 INPUT AMT$
6720 GOSUB 63000: LET PY$ = IN$
6730 INPUT R$
6740 INPUT CTG$
6750 IF CTG$ < >YY$ THEN 6870
6760 GOSUB 63000: LET MEM$ = IN$
6770 PRINT D$;"WRITE /RAM/MAIN.DATA,R";TN
6780 PRINT TN%
6790 PRINT DT$
6800 PRINT CN$
6810 PRINT AMT$
6820 PRINT PY$
6830 PRINT R$
6840 LET CTG$ = CG$(Q)
6850 PRINT CTG$
6860 PRINT MEM$
6870 NEXT
6880 PRINT D$;"CLOSE /RAM/MAIN.DATA"
8000 REM ALPHABETIZE
8010 FOR AL = 65 TO 92
8020 FOR J = 1 TO I
8025 IF LEN(CG$(J)) <1 THEN 8060
8030 IF ASC(CG$(J)) = AL THEN TG$(U) = CG$(J):TB$(U) = BG$(J):U = U +1
8040 IF ASC(CG$(J)) = AL +32 THEN TG$(U) = CG$(J):TB$(U) = BG$(J):U = U +1
8050 NEXT J
8060 NEXT AL
8070 U = 1
8080 FOR I = 1 TO 40
8085 IF TG$(I) = "\\\" THEN CG$(I) = ""
8090 IF LEN(CG$(I)) <1 THEN UN = I -1: GOTO 9000
8100 CG$(I) = TG$(I):BG$(I) = TB$(I): IF BG$(I) = "" THEN BG$(I) = "0.00"
8110 NEXT
9000 REM PRINT CATEGORY LIST
9010 HOME
9020 HTAB 31: VTAB 1: PRINT "---CATEGORY LIST---"
9030 VTAB 3
9040 FOR I = 1 TO 20
9050 IF LEN(CG$(I)) <1 THEN 9140
9060 PRINT CG$(I)
9070 NEXT
9080 VTAB 3
9090 FOR I = 21 TO 40
9100 IF LEN(CG$(I)) <1 THEN 9140
9110 HTAB 40
9120 PRINT CG$(I)
9130 NEXT
9140 HTAB 28: VTAB 23: PRINT "PRESS ANY KEY TO CONTINUE"
9150 GET X$
9155 IF FI = 1 THEN FI = 0: GOTO 4000
9160 GOTO 20000
10000 PRINT D$;"CHAIN /RAM/CW,@4005"
20000 REM SAVE CATEGORIES
20010 PRINT D$;"OPEN /RAM/CAT.DATA,L$20"
20020 FOR R = 1 TO 40
20030 PRINT D$;"WRITE /RAM/CAT.DATA,R";R
20040 CG$ = CG$(R):BG$ = BG$(R)
20050 PRINT CG$
20055 PRINT BG$
20060 NEXT
20070 PRINT D$;"CLOSE /RAM/CAT.DATA"
20100 GOTO 4000
30000 REM LOAD CATEGORIES
30010 PRINT D$;"OPEN /RAM/CAT.DATA,L$20"
30020 FOR R = 1 TO 40
30030 PRINT D$;"READ /RAM/CAT.DATA,R";R
30040 INPUT CG$
30045 INPUT BG$
30050 CG$(R) = CG$
30055 BG$(R) = BG$
30060 NEXT
30070 PRINT D$;"CLOSE /RAM/CAT.DATA"
30100 GOTO 4000
60000 END
62000 REM INPUT ANYTHING
62010 LET IN$ = "X"
62020 FOR J = 768 TO 790
62030 READ I
62040 POKE J,I
62050 NEXT J
62060 DATA 162,0,32,117,253,160,2,138,145,105,200,169,0,145,105,200,169,2,145,105,76,57,213
62070 RETURN
63000 REM CALL ANYTHING
63010 CALL 768
63020 IN$ = MID$ (IN$,1)
63030 RETURN